 class Student {
     public String name;
    private int age ;
    private String stuNum;
    public static String className;

     public String getName() {
         return name;
     }

     public void setName(String name) {
         this.name = name;
     }

     public int getAge() {
         return age;
     }

     public void setAge(int age) {
         this.age = age;
     }

     public String getStuNum() {
         return stuNum;
     }

     public void setStuNum(String stuNum) {
         this.stuNum = stuNum;
     }

     public static String getClassName() {
         return className;
     }

     public static void setClassName(String className) {
         Student.className = className;
     }

     public Student(){
         System.out.println("调用了这是不带参数的构造方法");
     }
          public Student(String name,int age,String stuNum){
         this.name =name;
         this.age = age;
         this.stuNum = stuNum;
         System.out.println("这是调用了3个参数的构造方法");
     }
     //
    public void setStudent(String name,int age,String studNum){
        this.name =name;
        this.age = age;
        this.stuNum = studNum;
    }
    //成员方法
     public void eat(){
         System.out.println(this.name+"正在吃饭");
     }
     public void doClass(){
         func();
         System.out.println(this.name+"正在上课");
     }
     private void func(){
         //其他的业务操作
         System.out.println("这个方法就是为本类其他访问服务的不对外公开");
     }
     public void show(){
         System.out.println("姓名："+this.name+"年龄："+this.age+"学号："+this.stuNum
         +"班级:"+className);
     }
    public void printStudent(){
        System.out.println(name+" "+age+" "+stuNum);
    }

     public static void main(String[] args) {
         Student student1 = null;
         System.out.println(student1.name);
     }

     public static void main3(String[] args) {
         Student student1 = new Student("zhangsan",18,"12345");
         Student.className ="2班";
         student1.show();
         Student student2 =new Student("lisi",19,"0987");
         student2.show();
     }
     public static void main2(String[] args) {
         Student student1 = new Student("lishengquan",18,"06615");
         student1.setStudent("李胜泉",18,"0641");
         student1.printStudent();
         Student student2 = new Student("zhangsan",17,"12345");
         student2.setStudent("文涛",18,"06636");
         student2.printStudent();
         Student student3 = new Student();
         student3.setStudent("廖子驹",18,"06639");
         student3.printStudent();
     }
    public static void main1(String[] args) {
        Student student1 = new Student();
        student1.name ="zhangsan";
        student1.age = 17;
        student1.stuNum = "12345";
        System.out.println(student1.name);
        System.out.println(student1.age);
        System.out.println(student1.stuNum);
    }
}

